package com.luan.xiaopozhan.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class RestResult<T>  {
    @Schema(description = "返回码", example = "200")
    private int code;
    private T data;
    @Schema(description = "消息", example = "请求成功")
    private String message;


    public static RestResult success() {
        RestResult restResult = new RestResult();
        restResult.setCode(200);
        restResult.setMessage("成功");
        return restResult;
    }

    public RestResult data(T param){
        this.setData(param);
        return this;
    }


}


